//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __DVM_H__
#define __DVM_H__

#include "xllp_defs.h"

typedef struct I2C_tag
{
    UInt32 IBMR; 
    UInt32 rsvd1;
    UInt32 IDBR; 
    UInt32 rsvd2;
    UInt32 ICR;
    UInt32 rsvd3;
    UInt32 ISR;
    UInt32 rsvd4;
    UInt32 ISAR;
}I2C_REG;



//MACRO defintion for the field of I2C reigsters

#define I2C_START   0x1
#define I2C_STOP    0x2
#define I2C_TB      0x8
#define I2C_MA      0x10
#define I2C_SCLE    0x20
#define I2C_IUE     0x40
#define I2C_GCD     0x80
#define I2C_ITEIE   0x100
#define I2C_IRFIE   0x200
#define I2C_BEIE    0x400
#define I2C_SDIE    0x800
#define I2C_ALDIE   0x1000
#define I2C_SADIE   0x2000
#define I2C_UR      0x4000
#define I2C_FM      0x8000

#define I2C_ITE     0x40
#define I2C_ARB     0x20


//define the MACRO for Power Management Change Control Register
#define PVCR_VCSA                  (0x1<<14)
#define PVCR_CommandDelay          (0xf80)

//define MACRO for Power Manager General Configuration Register (PCFR)
#define PCFR_FVC                   (0x1 << 10)
#define PCFR_PI2C_EN               (0x1 << 6)

//define MACRO for Power Manager I2C Command Register File (PCMD)
#define PCMD_MBC                  (0x1 << 12)
#define PCMD_DCE                  (0x1 << 11)
#define PCMD_LC                   (0x1 << 10)
#define PCMD_SQC                  (0x3 << 8)

typedef struct
{
    unsigned long CPDIS;
    unsigned long PDDIS;
    unsigned long NMulti;
    unsigned long LMulti;
    unsigned long fastbus_mode;
    unsigned long turbo_mode;

} FREQ_STATUS;

typedef struct
{
    Byte LMulti;
    Byte NMulti;
    Byte fastbus_mode;
    Byte turbo_mode;
    Byte DacValue;

} COMBO_PARAM, *PCOMBO_PARAM;

#define RUN_MODE          0
#define TURBO_MODE        1


#define CPDIS             0x80000000
#define PDDIS             0x40000000

#endif
